const AIService = require('./services/ai/aiService');

// 初始化AI服务
const aiService = new AIService();

// 测试单例模式评估
async function testSingletonEvaluation() {
  try {
    console.log('Testing Singleton pattern evaluation...');
    
    const solution = `
    public class Logger {
      private static Logger instance;
      private Logger() {}
      public static synchronized Logger getInstance() {
        if (instance == null) {
          instance = new Logger();
        }
        return instance;
      }
    }`;
    
    const result = await aiService.evaluateSolution(
      'Singleton',
      'Implement a thread-safe Singleton',
      solution,
      'beginner'
    );
    
    console.log('Evaluation result:', result);
  } catch (err) {
    console.error('Error testing AI evaluation:', err);
  }
}

// 执行测试
testSingletonEvaluation(); 